package com.augurit.gzcgwsp.common.web;

import java.io.File;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.augurit.common.base.action.ExtBaseAction;
import com.augurit.gzcgwsp.commonex.system.util.WebContextUtilsEX;
@SuppressWarnings("serial")
@Results({
	@Result(name ="DOWN", location = "common-download.action?id=${id}", type = "redirect"),
	@Result(name ="NOTEXIT", location = "/wf/app/document/filenotexit.jsp")
	
})
public class YwCommonAction  extends ExtBaseAction {
	private String id;
	public String downloadNtkoInstall()throws Exception{
		String url = WebContextUtilsEX.NTKO_DOC_PATH;
		id = "ntko";
		File newFile =null;
		String realUrl = this.getSysRealPath() + url;
		System.out.println(realUrl);
		newFile =new File(realUrl);
		
		if(newFile!=null &&newFile.exists()){
			return "DOWN";
		}else{
			return "NOTEXIT";
		}
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
}
